<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>通过id获取元素</title>
	</head>
	<body>
		<div id="time">2020-11-25</div>
		<script type="text/javascript">
			var timer = document.getElementById('time');
			console.dir(timer.textContent)
		</script>
	</body>
</html>
